Repository navigation
Host browser test: the documents probe reports both results in one message - #51
Merged
Merged
Conversation
…ssage The hostile renderer's documents probe sent two reports as `error` messages: what the host answered, then "nested graph ready" once the nested graph renderer started. Each report replaces the last, so when the nested frame became ready before the test read the first report (often on WebKit, 17 of 30 local runs), the answers were gone and the test timed out. The probe now sends one cumulative report, sent again when the nested renderer is ready, as the VS Code smoke probe already does, and the test waits for both parts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the test-only changes addressing the browser-test reporting race.
No open issues 🎉
What changed in this PR
Fixes a race in the host browser test where nested-renderer readiness could overwrite document results before Playwright read them. Changes are limited to the test renderer and browser test; product code is unchanged.
Changes:
- Make the documents probe report document results and nested-renderer status together.
- Wait for the combined report while retaining the assertion that path-based requests are dropped.
| File | Description |
|---|---|
tools/storybook/test-renderers/hostile/index.html |
Sends cumulative document results and nested-renderer status. |
packages/host/core/browser/host.spec.ts |
Asserts document results and nested readiness in one report. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the flaky host test "a renderer gets built-in renderer documents by name only, and can run one in a frame of its own", which timed out on WebKit desktop in `browser (packages/host/core, 1/3)` on #45 and #46 (for example, job 135040959158).
Cause
The hostile test renderer's `documents` probe (from #24) reported two things as `error` messages, one after the other:
A renderer's error replaces its previous one in the alert. When the nested frame became ready before Playwright read the alert, the first report had already been replaced, and `toContainText` waited for text that would never come back. The failing run's alert read: "The renderer reported a problem: nested graph ready". Locally it failed 17 of 30 times on WebKit desktop (`--repeat-each=30`).
Fix
The probe now sends one cumulative report, `documents …; nested graph loading|ready`, and sends it again when the nested renderer is ready. This is how the VS Code smoke probe in `nested-renderers.cjs` already works. The test waits for the full report, so it still requires the nested renderer to become ready under the nesting frame's policy. It still asserts that the request naming a path was dropped. Only the test renderer and the test change; the product is untouched.
Verified